<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/
//根路由
Route::get('/', function () {
    return view('welcome');
});

//根路由
Route::get('/home',function () {
    return 'hello home';
});

//any路由
Route::any('/test',function () {
    return 'hello test';
});

//macth路由
Route::match(array('get','post'),'title',function () {
    return 'hello title';
});

//必选参数
Route::any('/admin/{id}',function ($id) {
    return '这是一个'.$id.'的数';
});

//可选参数
Route::any('/content/{id?}',function ($id = 0) {
    return '这是一个'.$id.'的数';
});

//用？传递参数
Route::any('/list',function(){
    return '这是一个'.$_GET['id'];
});

//路由群主
Route::group(array('prefix'=>'index'),function(){
    Route::get('index1',function(){
        return '当前访问index1';
    });
    Route::get('index2',function(){
        return '当前访问index2';
    });
    Route::get('index3',function(){
        return '当前访问index3';
    });
});
//Route::请求方式（'请求路由','控制器@方法'）
Route::get('/home/test/test1','TestController@test1');


//前台模块
Route::get('/home/index/index','Home\IndexController@index');
//测试Input获取的数据
Route::get('/home/index/index2','Home\IndexController@index2');









//后台模块
Route::get('/admin/index/index','Admin\IndexController@index');